package cn.wsalix.admin.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import lombok.Data;
import lombok.EqualsAndHashCode;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import cn.anlaser.entity.CommonEntity;

@Entity
@Table(name = "ADMIN_RELATION")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@DynamicUpdate
@DynamicInsert
@Data
@EqualsAndHashCode(callSuper = false)
public class Relation extends CommonEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = -4621085153432017303L;
	private Long preFixId;
	/**
	 * 
	 */
	private Long postFixId;
	/**
	 * 1,用户角色-
	 * 2，角色菜单-
	 * 3，广告文章
	 * 4，广告图片
	 * 5，收藏用户
	 * 6，
	 */
	@ManyToOne(cascade = CascadeType.MERGE, optional = false, fetch = FetchType.LAZY)
	@JoinColumn(name = "TYPE_ID")
	private SysDict type;//

}